package cn.dzhang.spring.boot.protocol;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource({ "file:protocol.properties", "file:hello.properties" })
@ConfigurationProperties(prefix = "coverview")
public class ProtocolConfig {
	private static final Log log = LogFactory.getLog(ProtocolConfig.class);

	private List<String> hosts = new ArrayList<>();

	@Value("${snmp.trap.enabled}")
	private boolean trapEnabled;

	public List<String> getHosts() {
		return hosts;
	}

	@PostConstruct
	public void print() {
		log.info(trapEnabled);
		log.error(hosts);
	}

}
